import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/iconfont.css'
import './assets/reset.css'

import Vant from 'vant'
import 'vant/lib/index.css'

import axios from 'axios'
axios.defaults.baseURL = 'https://api-hmugo-web.itheima.net/api/public/v1'
axios.interceptors.request.use(config => {
  console.log('axios拦截')
  // console.log('config', config)
  vm.$toast.loading({
    message: '加载中...',
    forbidClick: true,
    loadingType: 'spinner'
  })
  return config
})

axios.interceptors.response.use(config => {
  // vm.$toast.success('请求成功')
  return config
})

Vue.prototype.$http = axios
Vue.use(Vant)
Vue.config.productionTip = false

const vm = new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
